<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>{$head[title]}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta content="{$head[keywords]}" name="keywords" />
<meta content="{$head[description]}" name="description" />
<base href="{SITE_URL}" />
<link href="favicon.ico" rel="shortcut icon" />
<link href="../skin/style.css" rel="stylesheet" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="{$head[title]}" href="/rss.php?rssid={$catid}" />
<script language="JavaScript" src="misc/config.js"></script>
<script language="JavaScript" src="misc/jquery.min.js"></script>
<script language="JavaScript" src="misc/common.js"></script>
<script language="JavaScript" src="misc/validator.js"></script>
<script language="javascript" src="misc/jquery.min.js"></script>
<script language="javascript" src="misc/ajaxfileupload.js"></script>
</head>
<body>

{template 'header.html'}

<div class="container">
	
    <div class="main">
		
    {template 'menu.html','member'} 
    
    <div class="mod"> 
        <div class="body">
            
            <form name="form" method="post" action="?module=member&action=upload" enctype="multipart/form-data">
            <table cellpadding="0" cellspacing="0" class="table_form" style="margin-top:0;">
              <tr>
                <td width="167"><img id="previewpic" src="{$avatar}" width="150" height="150" /></td>
                 <td width="431">
                   <input name="preview" type="file" id="preview" size="15" />
                         <input type="hidden" name="oldname">
                         <input type="hidden" name="rename" value="{$rename}">
                         <input type="hidden" name="MAX_FILE_SIZE" value="{UPLOAD_MAXSIZE}"> 
                         <!--<input type="button" name="dosubmit" value=" 上传 " onclick="return ajaxFileUpload();">-->
                         <input type="submit" name="dosubmit" value=" 上传 "  class="btn btn-primary">
                         
                         
                         <font id="err" color="red"></font><br />图片最大为{sizecount(UPLOAD_MAXSIZE)},支持jpg|jpeg|gif|bmp|png格式
                  </td>
               </tr>
            </table>
            </form> 
        </div>
    </div> 

</div>
    
    <div class="aside"> 
       {template "left.html", "member"}
    </div>
</div>


<script language="javascript">
uploadurl = "{UPLOAD_URL}";
function ajaxFileUpload()
{
	if($('#preview').val() == '') 
	{
		alert('上传头像为空');
		return false;
	}
	$.ajaxFileUpload
	(
		{
			url:"{PLU_PATH}upload/?dosubmit=1",
			secureuri:false,
			fileElementId:'preview',
			dataType: 'script',
			success: function (data, status)
			{
				if(data.indexOf(uploadurl) != -1)
				{
					$('#avatarid').attr('src', data);
					$('#previewpic').attr('src', data);
				}
				else
				{
					$('#err').html(data);
				}
			},
			error: function (data, stauts, e)
			{
				alert(e);
			}
		}
	)
	return false;
}
</script>
{template 'footer.html'}